<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组</title>
    <script>
        var arr1 = new Array(3);
        arr1[0] = 1;
        arr1[1] = 2;
        arr1[2] = 3;

        for (var i = 0; i < arr1.length; i++) {
            console.log("arr1内的元素有--->" + arr1[i])
        };

        var arr2 = new Array("钱多多",18,"java","togogo");
        for (var i = 0; i < arr2.length; i++) {
            console.log("arr2内的元素有--->" + arr2[i])
        };

        var arr3 = ["钱美美",17,"Html","togogo"];
        for (var i = 0; i <arr3.length; i++) {
            console.log("arr3数组内的元素有-->" + arr3[i]);
        }

        console.log(arr3.length);
        console.log(arr3.toString());
        var arr4 = arr3.concat(arr1);
        console.log(arr4);
        console.log(arr4.join("-"));
        console.log(arr4.reverse());
        var arr5 = [0,1,2,3,4,5,6,7,8,9]
        console.log(arr5.slice(0,4));

        var nums = [1,3,5,7,9,2,4,6,8,0]
        var arr6 = nums.sort();
        console.log(arr6);
    </script>
</head>
<body>

</body>
</html>